2000 |
How can I change the visual appearance of the filter bar's close button (solid)
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/ oG2antt:SetProperty("Background",1/*exFooterFilterBarButton*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1999 |
Is it possible to prevent definitely showing the filter bar's close button
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/ oG2antt:SetProperty("Background",1/*exFooterFilterBarButton*/,-1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1998 |
Is it possible to show the close button only if there is a filter applied
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 513/*exFilterBarShowCloseIfRequired+exFilterBarPromptVisible*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1997 |
The control's filter bar is not closed once I click the close button (toggle)
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oItems:SetProperty("LockedItemCount",2/*exBottom*/,1) h := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("CellValue",h,0,"<c><fgcolor=808080>Press the CTRL + F to turn on/off the control's filter bar. ALT + Up/Down moves the focus.") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oG2antt:FilterBarCaption := "`<r><fgcolor=808080>` + value" oG2antt:FilterBarPromptPattern := "B" oG2antt:FilterBarPromptVisible := 2323/*exFilterBarCompact+exFilterBarToggle+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/ oColumn1 := oG2antt:Columns:Item(0) oColumn1:FilterType := 240/*exFilter*/ oColumn1:Filter := "Item B" oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1996 |
How can I display the control's filter on a single line
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarCaption := "len(value) ? `filter for: <fgcolor 808080>` + value : `<fgcolor 808080>no filter`" oG2antt:FilterBarPromptVisible := 18/*exFilterBarSingleLine+exFilterBarVisible*/ oColumn1 := oG2antt:Columns:Item(0) oColumn1:FilterType := 240/*exFilter*/ oColumn1:Filter := "Item A|Item B" oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1995 |
How can I display the control's filter on a single line (prompt-combined)
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarCaption := "`<r>` + value" oG2antt:FilterBarPromptVisible := 2067/*exFilterBarCompact+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/ oColumn1 := oG2antt:Columns:Item(0) oColumn1:FilterType := 240/*exFilter*/ oColumn1:Filter := "Item A|Item B" oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1994 |
How can I get the number of results after a filter is applied
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN PROCEDURE OnClick(oG2antt) oG2antt:ClearFilter() RETURN PROCEDURE OnFilterChange(oG2antt) DevOut( "Items.MatchItemCount" ) DevOut( Transform(oG2antt:Items:MatchItemCount(),"") ) DevOut( Transform(oG2antt:FormatABC("value < 0 ? `filter applied: ` + abs(value + 1) + ` result(s)` : `no filter`",oG2antt:Items:MatchItemCount()),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:Click := {|| OnClick(oG2antt)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/ oG2antt:FilterChange := {|| OnFilterChange(oG2antt)} /*Occurs when the filter was changed.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/ oG2antt:FilterBarPromptPattern := "Item" oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1993 |
How can I programmatically clear the control's filter
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN PROCEDURE OnClick(oG2antt) oG2antt:ClearFilter() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:Click := {|| OnClick(oG2antt)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/ oG2antt:FilterBarPromptPattern := "B" oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1992 |
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt-combined)
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptPattern := "B" oG2antt:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/ oColumn1 := oG2antt:Columns:Item(0) oColumn1:FilterType := 240/*exFilter*/ oColumn1:Filter := "Item B" oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1991 |
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt)
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/ oG2antt:FilterBarPromptPattern := "B" oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1990 |
Is it possible to prevent closing the control's filter bar, so it is always shown
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():AddBar(Item,"Task","12/04/2017","12/14/2017") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/02/2017" oChart:SetProperty("PaneWidth",.F.,256) oG2antt:Columns():Add("Item"):DisplayFilterButton := .T. oColumn := oG2antt:Columns():Add("Pos") oColumn:AllowSizing := .F. oColumn:AllowSort := .F. oColumn:Width := 32 oColumn:FormatColumn := "1 apos ``" oColumn:Position := 0 oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:FilterBarCaption := "len(value) = 0 ? `<fgcolor=808080>no filter` : value" oG2antt:FilterBarPromptVisible := 2/*exFilterBarVisible*/ oColumn1 := oG2antt:Columns:Item(0) oColumn1:FilterType := 240/*exFilter*/ oColumn1:Filter := "Item B" oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1989 |
What are the options to align the percent caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Clip") oG2antt:ScrollBySingleLine := .T. oG2antt:DrawGridLines := -2/*exRowLines*/ oChart := oG2antt:Chart() oChart:AllowResizeChart := 6/*exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oChart:DrawGridLines := -2/*exRowLines*/ oChart:FirstVisibleDate := "12/26/2000" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,256) oBar := oChart:Bars():Add("Task%Progress") oBar:Shortcut := "Task" oBar:Pattern := 32/*exPatternBox*/ oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 164,164,164 } ) , .F. )) oBar:SetProperty("StartColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oBar:SetProperty("EndColor",oBar:StartColor()) oBar:OverlaidType := 4611/*exOverlaidBarsIncludeCaption+exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/ oBar:Height := 15 oBar:SetProperty("Def",12/*exBarPercent*/,0.5) oBar:SetProperty("Def",14/*exBarShowPercentCaption*/,.T.) oBar:SetProperty("Def",13/*exBarPercentCaptionFormat*/,"<sha ;;0>%p%") oItems := oG2antt:Items() h := oItems:AddItem("no clip, (0-2)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,2) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",15/*exBarAlignPercentCaption*/,1) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,0) h := oItems:AddItem("clip, inside (3-5)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,5) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",15/*exBarAlignPercentCaption*/,4) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,3) h := oItems:AddItem("hide on min width, clip if not fit, inside (6-8)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,8) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",15/*exBarAlignPercentCaption*/,7) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,6) h := oItems:AddItem("hide if not fit, no clip, inside (9-11)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,11) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",15/*exBarAlignPercentCaption*/,10) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,9) h := oItems:AddItem("no clip, inside, outside (12-14)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,14) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",4/*exBarHAlignCaption*/,13) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,12) h := oItems:AddItem("no clip, outside (16-18)") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:SetProperty("ItemBar",h,"K1",15/*exBarAlignPercentCaption*/,18) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2") oItems:SetProperty("ItemBar",h,"K2",15/*exBarAlignPercentCaption*/,17) oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K3") oItems:SetProperty("ItemBar",h,"K3",15/*exBarAlignPercentCaption*/,16) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1988 |
Is it possible to determine whether a bar is in the current display area
PROCEDURE OnBarResizing(oG2antt,Item,Key) oG2antt:Refresh() RETURN PROCEDURE OnDateChange(oG2antt) oG2antt:Refresh() RETURN PROCEDURE OnFormatColumn(oG2antt,Item,ColIndex,Value) LOCAL e,l,r,s s := oG2antt:Items:ItemBar(Item,"A",1/*exBarStart*/) e := oG2antt:Items:ItemBar(Item,"A",2/*exBarEnd*/) l := oG2antt:FormatABC("A < B",e,oG2antt:Chart:FirstVisibleDate()) r := oG2antt:FormatABC("A > B",s,oG2antt:Chart:DateFromPoint(1,-1)) Value := oG2antt:FormatABC("( A or B ) ? `<fgcolor=C0C0C0>hidden` : `<b>visible`",l,r) RETURN PROCEDURE OnLayoutChanged(oG2antt) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BarResizing := {|Item,Key| OnBarResizing(oG2antt,Item,Key)} /*Occurs when a bar is moving or resizing.*/ oG2antt:DateChange := {|| OnDateChange(oG2antt)} /*Occurs when the first visible date is changed.*/ oG2antt:FormatColumn := {|Item,ColIndex,Value| OnFormatColumn(oG2antt,Item,ColIndex,Value)} /*Fired when a cell requires to format its caption.*/ oG2antt:LayoutChanged := {|| OnLayoutChanged(oG2antt)} /*Occurs when column's position or column's size is changed.*/ oG2antt:BeginUpdate() oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Visible") oColumn:FireFormatColumn := .T. oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oChart := oG2antt:Chart() oChart:OverviewVisible := -1/*exOverviewShowAll*/ oChart:OverviewHeight := 64 oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oG2antt:SetProperty("SelBackColor",oG2antt:BackColor()) oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor()) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/08/2017","A") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2018","08/10/2018","A") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2019","08/12/2019","A") oItems:SetProperty("SelectItem",oItems:FocusItem(),.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1987 |
How can I ensure that the bar fits the control's client area
PROCEDURE OnSelectionChanged(oG2antt) LOCAL h,k,s h := oG2antt:Items:FocusItem() k := oG2antt:Items:FirstItemBar(h) s := oG2antt:FormatABC("(A+B)/2",oG2antt:Items:ItemBar(h,k,1/*exBarStart*/),oG2antt:Items:ItemBar(h,k,2/*exBarEnd*/)) oG2antt:Chart():ScrollTo(s,1) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:SelectionChanged := {|| OnSelectionChanged(oG2antt)} /*Fired after a new item has been selected.*/ oG2antt:BeginUpdate() oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/08/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2018","08/10/2018") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2019","08/12/2019") oItems:SetProperty("SelectItem",oItems:FocusItem(),.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1986 |
Is it possible to change the caption from a column without to remove the column and add it with the new caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("ColumnName"):Caption := "NewName" oG2antt:Columns():Add("ColumnName"):HTMLCaption := "<b>New</b>Name" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1985 |
How can I display the bar's duration in days, minutes, and so so on
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oColumns LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumns := oG2antt:Columns() oColumns:Add("Tasks"):AllowSizing := .F. oColumn := oColumns:Add("Duration") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A") oColumn:FormatColumn := "trim((1:=int((0:=value)/365) ? =:1 + ` year(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*365)))/31) ? =:1 + ` month(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*31)))/7) ? =:1 + ` week(s) ` : ``) + (1:=int((0:=(=:0 - (=:1*7)))/1) ? =:1 + ` day(s) ` : ``) + (1:=int((0:=(=:0 - =:1 + 1/24/60/60/2))*24) ? =:1 + ` hour(s) ` : ``) + (1:=int((0:=(=:0*24 - =:1))*60) ? =:1 + ` min(s) ` : ``) + (1:=int((0:=(=:0*60 - =:1))*60) ? =:1 + ` sec(s)` : ``))" oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "12/30/2001" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,196) oChart:Bars():Add("Task:Split"):Shortcut := "Task" oChart:OverviewVisible := -1/*exOverviewShowAll*/ oChart:OverviewHeight := 64 oChart:ResizeUnitScale := 16777216/*exSecond*/ oChart:AllowResizeChart := 262/*exAllowChangeUnitScale+exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","12/31/2001","01/07/2002","A") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/01/2002","02/14/2002","A") h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","01/02/2002 10:00:00","01/02/2002 12:00:00","A") h := oItems:AddItem("Task 4") oItems:AddBar(h,"Task","01/03/2002","01/04/2002 08:30:30","A") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1984 |
How can I change the background color for checked items (EBN color, frame)
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:DefaultItemHeight := 22 oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oAppearance := oG2antt:VisualAppearance() oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABUkIQAAYAQGKIcBiAKBQAGYBIJDEMQ3DjAUBjMK4ZwTC4AIQjCK4JDKHYJRpHEZgLBMJAAGIZYhhUYRUiYMkiJBGGDIDiGGI2SJAcbTVIEcx9EyUJSgSTJOjCMokTTIU4TTLYASbJafJJhWSaAiyMouDIOMg1BDNIw/Hika6jOgKUisNJXRzWIBTbDlOQ3JqnbCjOQRSrQBoNDAMAiiaKlbwJPK9RoieQXfwUAJrXJcFqXFSLVxNBKAQEBA=") oAppearance:Add(1,"CP:2 1 1 -1 -1") oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") oConditionalFormat:SetProperty("BackColor",0x1000000) oConditionalFormat:SetProperty("ChartBackColor",oConditionalFormat:BackColor()) oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1983 |
How can I change the caption of the checked items (sample 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SetProperty("SelBackColor",oG2antt:BackColor()) oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor()) oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "%CS0 = 1 ? `<bgcolor=000000><fgcolor=FFFFFF> ` + value + ` </fgcolor></bgcolor>` : value" oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,256) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1982 |
How can I change the caption of the checked items (sample 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)" oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,256) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1981 |
How can I change the font for the checked items
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild LOCAL f oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:DefaultItemHeight := 22 oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") f := CreateObject("StdFont") f:Name := oG2antt:Font():Name() f:Size := 12 oConditionalFormat:Font := f oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,196) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1980 |
How can I bold the checked items
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") oConditionalFormat:Bold := .T. oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1979 |
How can I change the foreground color for checked items
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SelBackMode := 1/*exTransparent*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. )) oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1978 |
How can I change the background color for checked items (solid color)
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Refresh() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SelBackMode := 1/*exTransparent*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. )) oConditionalFormat:SetProperty("ChartBackColor",oConditionalFormat:BackColor()) oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1977 |
How can I change the color for checked Task bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0 = 1") oConditionalFormat:ApplyToBars := "Task,Summary" oConditionalFormat:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1976 |
I have defined "NonWorkingHours" for the Gantt, and the "exBarWorkingCount" properly excludes these hours as long as the Gantt is using "exDay" or "exHour" as the level unit. However when displaying a quarter or a year, I'm changing the unit to "exWeek", but then the "NonWorkingHours" are no longer excluded from the bars "exBarWorkingCount" and displays the wrong value
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart,oChart1 LOCAL oColumn LOCAL oColumns LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oColumns := oG2antt:Columns() oColumns:Add("Tasks"):AllowSizing := .F. oColumn := oColumns:Add("Working") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A") oColumn:FormatColumn := "((1:=int(0:=( 24*int(value) + (value - int(value) + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')" oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:AllowResizeChart := 262/*exAllowChangeUnitScale+exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oChart:SetProperty("PaneWidth",.F.,196) oChart:Bars():Add("Task:Split"):Shortcut := "Task" oChart:FirstVisibleDate := "01/03/2002" oChart:LevelCount := 2 oChart:Level(0):Label := "<%ddd%>" oChart:Level(1):Label := "<%hh%>" oChart:NonworkingHours := 16761855 oChart:ShowNonworkingUnits := .F. oChart:ShowNonworkingUnits := .F. oChart:OverviewVisible := -1/*exOverviewShowAll*/ oChart:OverviewHeight := 64 oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/04/2002","01/08/2002","A") oItems:SetProperty("ItemBar",h,"A",20/*exBarKeepWorkingCount*/,.T.) h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/03/2002","01/04/2002","A") oItems:SetProperty("ItemBar",h,"A",20/*exBarKeepWorkingCount*/,.T.) oChart1 := oG2antt:Chart() oChart1:UnitScale := 4096/*exDay*/ oChart1:ScrollTo(oChart1:FirstVisibleDate(),1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1975 |
Is it possible to customize the editor selection colour of the built in text editor, from standard blue to black
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oEditor := oG2antt:Columns():Add("Edit"):Editor() oEditor:EditType := 8/*MaskType*/ oEditor:Mask := ";;;rich" oItems := oG2antt:Items() oItems:AddItem("") oItems:AddItem("Just a text") oItems:AddItem("") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1974 |
Is it possible to customize the editor selection colour of the built in dropdown editor, from standard blue to black
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oEditor := oG2antt:Columns():Add("DropDown"):Editor() oEditor:AddItem(1,"This is just the first item") oEditor:AddItem(2,"This is just the second item") oEditor:AddItem(3,"This is just the third item") oEditor:EditType := 2/*DropDownType*/ oEditor:Mask := ";;;rich" oItems := oG2antt:Items() oItems:AddItem("") oItems:AddItem("Just a text") oItems:AddItem("") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1973 |
When I display the chart in the daily view, the histogram shows correctly the data while if the chart displays the data in weekly or monthly view, the histogram shows no data or incorrectly. What can be the problem
PROCEDURE OnOverviewZoom(oG2antt) oG2antt:Chart():ResizeUnitScale := 4096/*exDay*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:OverviewZoom := {|| OnOverviewZoom(oG2antt)} /*Occurs once the user selects a new time scale unit in the overview zoom area.*/ oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Effort") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,21) oColumn:Editor():EditType := 4/*SpinType*/ oChart := oG2antt:Chart() oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oChart:OverviewZoomCaption := "|||<img>3</img>Month|Third|<img>2</img>Week|<img>1</img>Day|||" oChart:SetProperty("Label",0/*exYear*/,"") oChart:SetProperty("Label",1/*exHalfYear*/,"") oChart:SetProperty("Label",2/*exQuarterYear*/,"") oChart:SetProperty("Label",17/*exThirdMonth*/,"") oChart:SetProperty("Label",65536/*exHour*/,"") oChart:SetProperty("Label",1048576/*exMinute*/,"") oChart:SetProperty("Label",16777216/*exSecond*/,"") oChart:OverviewZoomUnit := 64 oChart:LevelCount := 2 oChart:NonworkingDays := 0 oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 128 oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:OverviewVisible := -1/*exOverviewShowAll*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := oBar:Pattern() oBar:HistogramType := 0/*exHistOverload*/ oBar:HistogramCriticalValue := 3 oBar:HistogramItems := -7 oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. )) oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","06/21/2005","06/23/2005") oItems:SetProperty("CellValue",h1,1,4) h1 := oItems:AddItem("Task 2") oItems:AddBar(h1,"Task","06/24/2005","06/26/2005") oItems:SetProperty("CellValue",h1,1,3) h1 := oItems:AddItem("Task 3") oItems:AddBar(h1,"Task","06/27/2005","06/29/2005") oItems:SetProperty("CellValue",h1,1,2) h1 := oItems:AddItem("Task 4") oItems:AddBar(h1,"Task","06/30/2005","07/02/2005") oItems:SetProperty("CellValue",h1,1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1972 |
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that
PROCEDURE OnBeforeExpandItem(oG2antt,Item,Cancel) DevOut( "BeforeExpandItem" ) DevOut( Transform(Item,"") ) DevOut( "ColumnFromPoint" ) DevOut( Transform(oG2antt:ColumnFromPoint(-1,-1),"") ) DevOut( "ColumnFromPoint return -1, if the user clicks the +/- glitch, else it returns the index of the column where the click occurs." ) oG2antt:Items():InsertItem(Item,,"new child") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oG2antt,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/ oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumns := oG2antt:Columns() oColumns:Add("Items"):DisplayFilterButton := .T. oItems := oG2antt:Items() oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 1"),.T.) oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 2"),.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1971 |
How do I change the drop down filter icon/button (black)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oChart LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oAppearance := oG2antt:VisualAppearance() oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQgmPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThdr4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA") oG2antt:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oG2antt:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000) oG2antt:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oG2antt:SetProperty("Background",27/*exForeColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oG2antt:SetProperty("Description",25/*exFilterBarExclude*/,"<bgcolor 0><fgcolor ffffff> Exclude </fgcolor></bgcolor>") oG2antt:HeaderAppearance := 0/*None2*/ oG2antt:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:SetProperty("ForeColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oG2antt:HeaderVisible := -1/*exHeaderVisible*/ oG2antt:SetProperty("BackColorLevelHeader",oG2antt:BackColor()) oColumn := oG2antt:Columns():Add("Filter") oColumn:FilterList := 8448/*exShowExclude+exShowCheckBox*/ oColumn:DisplayFilterButton := .T. oColumn:AllowSort := .F. oColumn:AllowDragging := .F. oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,196) oChart:LevelCount := 2 oChart:SetProperty("BackColorLevelHeader",oG2antt:BackColorHeader()) oChart:SetProperty("ForeColorLevelHeader",oG2antt:ForeColorHeader()) oItems := oG2antt:Items() oItems:AddItem("One") oItems:AddItem("Two") oItems:AddItem("Three") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1970 |
How do I change the z-order of the bars (percent)
PROCEDURE OnMouseMove(oG2antt,Button,Shift,X,Y) LOCAL b,i b := oG2antt:Chart:BarFromPoint(-1,-1) i := oG2antt:ItemFromPoint(-1,-1,c,hit) DevOut( Transform(oG2antt:Items:ItemBar(i,b,6/*exBarToolTip*/),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oG2antt,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oG2antt:DefaultItemHeight := 52 oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "10/10/2017" oChart:SetProperty("PaneWidth",.F.,0) oChart:NonworkingDays := 0 oChart:SetProperty("MarkTodayColor",oChart:BackColor()) oChart:Bars():Add("Task%Progress"):Shortcut := "Task" oBar := oChart:Bars():CallMethod("Copy","Task","T1") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:SetProperty("Def",3/*exBarCaption*/,"<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar:SetProperty("Def",12/*exBarPercent*/,0.25) oBar:SetProperty("Def",39/*exBarPercentColor*/,oBar:Color()) oBar:SetProperty("Def",18/*exBarOffset*/,10) oBar:SetProperty("Def",14/*exBarShowPercentCaption*/,.T.) oBar:SetProperty("Def",13/*exBarPercentCaptionFormat*/,"<font ;6><b>%p%</b>") oBar1 := oChart:Bars():CallMethod("Copy","Task","T2") oBar1:Height := 26 oBar1:SetProperty("Def",3/*exBarCaption*/,"<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>") oBar1:SetProperty("Def",5/*exBarVAlignCaption*/,16) oBar1:SetProperty("Def",12/*exBarPercent*/,0.25) oBar1:SetProperty("Def",39/*exBarPercentColor*/,oBar1:Color()) oBar1:SetProperty("Def",14/*exBarShowPercentCaption*/,.T.) oBar1:SetProperty("Def",13/*exBarPercentCaptionFormat*/,"<font ;6><b>%p%</b>") oItems := oG2antt:Items() h1 := oItems:AddItem("Task") oItems:AddBar(h1,"T1","10/15/2017","10/25/2017","2") oItems:SetProperty("ItemBar",h1,"2",17/*exBarData*/,"Bar A") oItems:SetProperty("ItemBar",h1,"2",6/*exBarToolTip*/,"Bar A <b>Over</b> Bar B") oItems:AddBar(h1,"T2","10/18/2017","10/22/2017","1") oItems:SetProperty("ItemBar",h1,"1",17/*exBarData*/,"Bar B") oItems:SetProperty("ItemBar",h1,"1",6/*exBarToolTip*/,"Bar B <b>Under</b> Bar A") h1 := oItems:AddItem("Task") oItems:AddBar(h1,"T1","10/15/2017","10/25/2017","1") oItems:SetProperty("ItemBar",h1,"1",17/*exBarData*/,"Bar A") oItems:SetProperty("ItemBar",h1,"1",6/*exBarToolTip*/,"Bar A <b>Under</b> Bar B") oItems:AddBar(h1,"T2","10/18/2017","10/22/2017","2") oItems:SetProperty("ItemBar",h1,"2",17/*exBarData*/,"Bar B") oItems:SetProperty("ItemBar",h1,"2",6/*exBarToolTip*/,"Bar B <b>Over</b> Bar A") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1969 |
How do I change the z-order of the bars
PROCEDURE OnMouseMove(oG2antt,Button,Shift,X,Y) LOCAL b,i b := oG2antt:Chart:BarFromPoint(-1,-1) i := oG2antt:ItemFromPoint(-1,-1,c,hit) DevOut( Transform(oG2antt:Items:ItemBar(i,b,6/*exBarToolTip*/),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oG2antt,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oG2antt:DefaultItemHeight := 52 oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "10/10/2017" oChart:SetProperty("PaneWidth",.F.,0) oChart:NonworkingDays := 0 oChart:SetProperty("MarkTodayColor",oChart:BackColor()) oBar := oChart:Bars():CallMethod("Copy","Task","T1") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar:SetProperty("Def",3/*exBarCaption*/,"<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1 := oChart:Bars():CallMethod("Copy","Task","T2") oBar1:Height := 25 oBar1:SetProperty("Def",3/*exBarCaption*/,"<%=%17 + `<b><font ;6><off -4> (z-key `+%9+`)`%>") oBar1:SetProperty("Def",5/*exBarVAlignCaption*/,16) oItems := oG2antt:Items() h1 := oItems:AddItem("Task") oItems:AddBar(h1,"T1","10/15/2017","10/25/2017","2") oItems:SetProperty("ItemBar",h1,"2",17/*exBarData*/,"Bar A") oItems:SetProperty("ItemBar",h1,"2",6/*exBarToolTip*/,"Bar A <b>Over</b> Bar B") oItems:AddBar(h1,"T2","10/18/2017","10/22/2017","1") oItems:SetProperty("ItemBar",h1,"1",17/*exBarData*/,"Bar B") oItems:SetProperty("ItemBar",h1,"1",6/*exBarToolTip*/,"Bar B <b>Under</b> Bar A") h1 := oItems:AddItem("Task") oItems:AddBar(h1,"T1","10/15/2017","10/25/2017","1") oItems:SetProperty("ItemBar",h1,"1",17/*exBarData*/,"Bar A") oItems:SetProperty("ItemBar",h1,"1",6/*exBarToolTip*/,"Bar A <b>Under</b> Bar B") oItems:AddBar(h1,"T2","10/18/2017","10/22/2017","2") oItems:SetProperty("ItemBar",h1,"2",17/*exBarData*/,"Bar B") oItems:SetProperty("ItemBar",h1,"2",6/*exBarToolTip*/,"Bar B <b>Over</b> Bar A") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1968 |
How do I get the duration/working count of the bar (sample 6,excrd)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn,oColumn1,oColumn2 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DefaultItemHeight := 48 oG2antt:ShowFocusRect := .F. oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:SetProperty("BackColorLevelHeader",oG2antt:BackColor()) oG2antt:DrawGridLines := -1/*exAllLines*/ oChart := oG2antt:Chart() oChart:DrawGridLines := 1/*exHLines*/ oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/26/2001" oBar := oChart:Bars():Add("Task:Split") oBar:Shortcut := "Task" oBar:SetProperty("Def",6/*exBarToolTip*/,"<%=%263%>") oBar:SetProperty("Def",18/*exBarOffset*/,-12) oChart:ColumnsFormatLevel := "1,2/3" oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Duration") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oColumn:Visible := .F. oColumn:Alignment := 0/*LeftAlignment*/ oColumn:FormatColumn := "value + `d`" oColumn1 := oG2antt:Columns():Add("Working") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258) oColumn1:Visible := .F. oColumn1:Alignment := 2/*RightAlignment*/ oColumn1:FormatColumn := "value + `w`" oColumn2 := oG2antt:Columns():Add("Working-Period") oColumn2:SetProperty("Def",18/*exCellValueToItemBarProperty*/,263) oColumn2:Visible := .F. oColumn2:Alignment := 1/*CenterAlignment*/ oColumn2:FormatColumn := "((value replace `\r\n` with `,`) replace `#` with ``) replace ` ` with ``" oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/11/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oItems:AddBar(oItems:AddItem("Task 3"),"Task","12/31/2001","01/13/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1967 |
How do I get the duration/working count of the bar (sample 5)
PROCEDURE OnAddItem(oG2antt,Item) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("ItemMaxHeight",Item,64) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn,oColumn1,oColumn2,oColumn3 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oG2antt:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,256) oChart:LevelCount := 2 oChart:FirstVisibleDate := "01/01/2002" oBar := oChart:Bars():Add("Task:Split") oBar:Shortcut := "Task" oBar:SetProperty("Def",6/*exBarToolTip*/,"<%=%263%>") oChart:ColumnsFormatLevel := "1,2" oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oColumn := oG2antt:Columns():Add("Task") oColumn:AllowSizing := .F. oColumn:Width := 48 oColumn1 := oG2antt:Columns():Add("Duration") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oColumn1:Visible := .F. oColumn1:Alignment := 0/*LeftAlignment*/ oColumn2 := oG2antt:Columns():Add("Working") oColumn2:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258) oColumn2:Visible := .F. oColumn2:Alignment := 2/*RightAlignment*/ oColumn3 := oG2antt:Columns():Add("Working-Period") oColumn3:SetProperty("Def",18/*exCellValueToItemBarProperty*/,263) oColumn3:SetProperty("Def",16/*exCellSingleLine*/,.F.) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/12/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2002","01/16/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1966 |
How do I get the duration/working count of the bar (sample 4)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/26/2001" oChart:Bars():Add("Task:Split"):Shortcut := "Task" oChart:ColumnsFormatLevel := "1,2" oG2antt:Columns():Add("Task"):Width := 48 oColumn := oG2antt:Columns():Add("Duration") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oColumn:Visible := .F. oColumn:Alignment := 0/*LeftAlignment*/ oColumn:FormatColumn := "value + `d`" oColumn1 := oG2antt:Columns():Add("Working") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258) oColumn1:Visible := .F. oColumn1:Alignment := 2/*RightAlignment*/ oColumn1:FormatColumn := "value + `w`" oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/12/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1965 |
How do I get the duration/working count of the bar (sample 3)
PROCEDURE OnBarResizing(oG2antt,Item,Key) LOCAL oItems oItems := oG2antt:Items() DevOut( oItems:CellCaption(Item,0) ) DevOut( "Working" ) DevOut( Transform(oItems:ItemBar(Item,Key,258/*exBarWorkingCount*/),"") ) DevOut( oItems:CellCaption(Item,0) ) DevOut( "Duration" ) DevOut( Transform(oItems:ItemBar(Item,Key,513/*exBarDuration*/),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BarResizing := {|Item,Key| OnBarResizing(oG2antt,Item,Key)} /*Occurs when a bar is moving or resizing.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/26/2001" oChart:Bars():Add("Task:Split"):Shortcut := "Task" oG2antt:Columns():Add("Task"):Width := 48 oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/12/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1964 |
How do I get the duration/working count of the bar (sample 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/26/2001" oBar := oChart:Bars():Add("Task:Split") oBar:Shortcut := "Task" oBar:SetProperty("Def",3/*exBarCaption*/,"<%=%258%>w") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar:SetProperty("Def",44/*exBarExtraCaption*/,"<%=%513%>d") oBar:SetProperty("Def",45/*exBarExtraCaptionHAlign*/,16) oG2antt:Columns():Add("Task"):Width := 48 oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/12/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1963 |
How do I get the duration/working count of the bar (sample 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,196) oChart:LevelCount := 2 oChart:FirstVisibleDate := "01/01/2002" oChart:Bars():Add("Task:Split"):Shortcut := "Task" oG2antt:Columns():Add("Task"):Width := 48 oG2antt:Columns():Add("Duration"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oG2antt:Columns():Add("Working"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,258) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2002","01/12/2002") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/03/2002","01/15/2002") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1962 |
How can I draw a solid frame around the the focusing item
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:DefaultItemHeight := 20 oAppearance := oG2antt:VisualAppearance() oAppearance:RenderType := -1 oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABOkGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEwpFAZBhgeDYMiSNoYDJCM4wHIURRJFCUJSGWQpTgSIgyT5HFIxXKoASbJabZLhWS6EpWOotTbIQQRYCkEyfKKfZyGURZQqOKA1DBZErWTJESRFJqLazgO4LAhyQYrVgAErzVKVCRNOqbJzADApdpGQJTULDNTQHRFIyhOSnIRrWbMAhid6JUZiVT4dBOIYhSYANAqCwLFqrDJmWrpV5WZjlZ47V6BdAyXJsIrmFJEXaOGhyDDlGybSDZYryfZhUziUw4XjbWwZDqPF6DKTTdSGLREE8WZVlURZvDaep3C+AY8kAYRgGCCBJECUhjDoHROEYWgoAGTQ1CEEx9lGMY0CQUYSnuZQDBGBYFlOH5+H+igGAKAJgEgFgGgGVgDn4CoCmCSA2A6A5hAgDgQgSYRIE4" +; "EoFGGCBiBeBhhkgPgbgcYgICoH4IGGWIOCSBhiGiHgVgoYooFoAoLGIWI+DCCgjCiTgrgII4ImYOoOmOSJ2AYOpWlQDQBICA=") oG2antt:ShowFocusRect := .T. oG2antt:SetProperty("Background",19/*exShowFocusRect*/,0x1000000) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,1) oColumn := oG2antt:Columns():Add("P1") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1961 |
The frame around the focusing item is not very clear. Can I show it larger or more cleared (sample 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:DefaultItemHeight := 20 oG2antt:ShowFocusRect := .T. oAppearance := oG2antt:VisualAppearance() oAppearance:RenderType := -1 oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABPEGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEwpFAZBhgeCRUgyJI3RgMUIzVAcRRFEiUJQlIZZCjOAw0SIMU7xZRcNxsACnaZnCR4NiuRYiUhOcqzRIQIQ4CiEahqOgJbDUJYwWZKAyjBY8XTZFCSJCpeJ6egOc5jRxQUp1WAEXx3GSsJKvCZ5cADBY+VLQNS0JBtMSTKSLaiuWoIJqCPaDRheWKQJh1NSnLqEcjyYANDxDCZlWzAYxWTZ2Uz7N7PbB0HY4DyPGKZYrfESVRbQcZNS6nNigPI9XhfGq6VjRe63ZaOaYpWrnOJqTRWjOKYujWdZ2BGO5lkuBAAkmcQkDmDBEAwEQJCgGhMGcQ4pkiSxGAAOYmkQIhvkYNg2gSCgyj+LI4GIMIwF2XQoAYAoAmASAWAaAZgggJgKFiT54DYDoDmECBGBKBJgGg" +; "TgWgWYRoFYGIGmGOBqByB5hCgegggiYJYgoJIICIaIeByChiigYgsgsYYYBYMIKCMKJOCuDRjGiOgLg6Y5InYPoPmQCAkmsXAQDQBCAg=") oAppearance:Add(3,"CP:2 -3 0 3 0") oG2antt:SetProperty("Background",19/*exShowFocusRect*/,0x3010101) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,1) oColumn := oG2antt:Columns():Add("P1") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1960 |
The frame around the focusing item is not very clear. Can I show it larger or more cleared (sample 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:ShowFocusRect := .T. oAppearance := oG2antt:VisualAppearance() oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABHoDg6AADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBIZQ7BKNIxjSJwFiCCQwSDKEjyCKcGRHF6MI6gOYpCgOIYjRJNIASVAceAAGaUZrjSgobjmOYhAJCLqhYIgASXJqLaBlOCaAieSc+QhjQJIJoeCZXU5TFg1BTsOhqEqcRiseaRVDCaIJWzbdYWLDdNQHHKYLjnWorbpSJZ5XjNEySDQkMS9PrEJ7vST8FBCdAABLJUB2BR9RwxRafKpnWwJDpmCaOQLXEB5DK1PyVMTKYrtGy7GrIAJxWxbV4UHh+QABOzIMAvHKJMwvHYcUZne5XVLeF41HbONogPaJZyIAK2cLROq6Xo7GEcJZEcLASB4DwvgWUZlE6AQQhKAYkkYdA6hyDIwHgSoqFwQgmnsYxjGgSIiBOTpSEiAwRgOJI7j4JAHA6U5wm0MpPlOBIjD8TZiGYCICiCGAuA6AxhAgMgSgOYQ4DY" +; "Bg/g6cw1n+ABOmMMJ9DmCwjnScw4RsVJngkYh4hoKIKmKKI2CmC5ikiQgqgiT5jhyMw8g4QwIn0OIKEiCJhD8DwTGyfA7k0WQOEWEQkGkJhIhKZB5DYSoTiSCQEn4PQOCOXJcCeIJjliaIQk0aRyF4O5llmAhfhgZhJg4ZoYiaAxYn4PZOhOZJaCUZYTiYQw1mcOZUm+HQnHmWh4h6Z4pnYeYfk0eYsmqG4nAgNJ2DqD5DkCWoiGiOgqgyI5omoRoNiSaQKFKEojCaM4ugSFhOjkAJcieKgDkaH4oioGoOiaKRqgqEoqDddwyhuAxPgOMJ8DyDZqk6NYtCsapmjiLprHqdo6i+K5K1oPhOlqPgKD4DpjnII4yiOewuk6MxtAsMpSjObQ7EaT4wk6ewYn0PgPAiCJkjeLgDk6X44i4G4OmaORuguEpqDkLAzkaWg+E8GIUmaPIvEOVpzj2Lxbl6eo+G+S5in4OYPmOaJyjuTwjnYWpBg6DAjAqQZwkwJw" +; "NkKcJsEcEJCDBEpaD6Dw8BiapGjGSgfB2RpxmyBwgkicZ8haBw/g+M5TBcPQPlOXJskscp8jsMJMnMLJXDGTZzEyYw2kwMoDlcFw9i2M4/EGUJPg0CxFlENBtCcSJSnQfQ0m+SgPHsaJ7lALZLG6XZVHWDRfFqVY1k0ZxdladYTnifJUGaeAWAeMnSGcGWgBObJ3lWbwdjKW5cHcTZPHaLkN4GxXDlFqFsA4uRbBOGAFAEIzAsDEFOBkfYqR4D6AOBEYo8QuBvAmMceInBDgcD0JwOIqQyJ1DMAwG4IANDnHSMoK4QhOgMBGNEIQvQWAdGenETIswGiddsAAQAgCAgA==") oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABeEGACAADACAxRDgMQBQKAAzAJBIYhkGYYYCgMZRUDGCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADDFIBQSLAYROGSDJBGODJDjWGIeQLOEhQHIMRxPE6UYLhWYpBDKPYcUbGc7yBBMVwGf59XzACoKSheQIVSDQkw6Fo6NYhAxHALyNRkBy8f60KjtGpodDUJYvW5JYyjBZ8EznOqbJBkeJ7BgOe5NQjaD72VgdWQJFSWJajWYYJDOJY2ZAAE5TVINEwxJbDaylChIdxaF6WAzZEBhBYoATPNLBMrhWqKDw2XaQWBCOgwHYeR5LU7BdRwbIrRq2eAAXbcVyXfDddZlBK+QA0SK9lRVTKvJZmKgBWw1COSxmAAGw4kcNx1iKFBiCAfQsG8lJemucg7nsXpUHOOxrm+DI3jOH4XAOBx2nscw0j2HhPG4L5uGEVIECQCBCEUAYkGMHQHFGSBlGaAxkEgQgTGCVBsDYQhCgQJZrHK" +; "UggGEShkFGNgIlsNpPnMHJHD+TADAIJIJiIWIeCqChikiIgmgiD5zHyXxgiACJKCuC4jHiZgtg6I4IlkCQwkwOIonMPJjEkFhGhGZBpA4KoMBCGJuEiE5lAkGg7hMY4JEYVoUCUNAOE6FZl0KWQACWOR2GKF5mBmChchkJRZhoXYaCKKYqGuDglEmNhuhWZpIiYc4dCcCRqGmHZlgm2YxAwSQKESHwkFkKgpiAIAIH4PIimOOg2DiChoiQJRRD+TZDHCfwyAyCgyg+JpiioYJ/DgDgIlECQ6lwRAEICA=") oAppearance:Add(3,"CP:2 -2 0 2 0") oG2antt:SetProperty("SelBackColor",0x1000000) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:Chart():SetProperty("PaneWidth",.T.,1) oG2antt:SetProperty("Background",19/*exShowFocusRect*/,0x3ff0000) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("P1") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1959 |
How can I display the start/end margins of bars, when cursor hovers it like a tooltip
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("exBarToolTip") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "01/01/2001" oChart:Bars:Item("Task"):SetProperty("Def",6/*exBarToolTip*/,"<b><%=%9 + '/' + %C0%></b><br><upline><dotline>Start: <%=%1%><br>End: <%=%2%><br>Duration: <%=(%2-%1)%><br>Working: <%=%258%>") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Bar.Def"),"Task","01/02/2001","01/09/2001","K1") oItems:AddBar(oItems:AddItem("Bar.Def"),"Task","01/03/2001","01/10/2001","K1") h := oItems:AddItem("Items.ItemBar") oItems:AddBar(h,"Unknown","01/04/2001","01/11/2001","K") oItems:SetProperty("ItemBar",h,"K",6/*exBarToolTip*/,"Start:<%=%1%><br>End:<%=%2%>") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1958 |
Is it possible to define different kinds of summary bars with using the EBN files
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL hSummaryJ,hSummaryK,hSummaryZ,hTaskJ,hTaskK,hTaskZ oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oAppearance := oG2antt:VisualAppearance() oAppearance:RenderType := -16777216 oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABN0GACAADACAxRDAMgBQKAAzQFAYahuGSGAAGMYxQgmFgAQhFcZQSKUOQTDKMIziYBYJhEMQyDAAUIjOKsIhkGYcZAGQBJCjWGodQLOEgwHIERQjEyUJAGGQIHhyPYbUbGUpQHKkeRtGqgBgoKhKEouNYgAbGYIwTRsdyfDSXBpEWwbDgkNQwWTDNoRDIUQStCysaYjOpnfrUAJ1P7FdQ1NJkXRhGSSK7maapaiCSZ6STCMj1FhVKSNJ7DQKhGpgKh/ApgYpQOK4fLNXyRBK4QAyKA6bgPFZOZbFViaXY1V5bNKrcjhHQwAyHJ4XXRdV4YRAkUT4GqiJKGSYcQhuXZWbRqO6ABhef6DRThc6jKpFHIE4llEcojHqSZNgoIxnlgd5thsLREleL43gsYZ9BkaAYkMAgAm+CxGDWWAtiKCRfjcdRgHoHYnicUwgAIEIREAaQYkcQZUHIGRUDQJBOEYRAhDYCxGgMZAkCgdYQha" +; "XQIAYERwQuahXggdgeG6VZ4H4IhdiIGIOB8YIiGiHZZgqYpGF4KYHiKCI+CAU5jCiTQ2g0YhEFyax4gABAEIC") oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABU0IQAAYAQGKQYhiAKBQAGaAoDDcMA4QwAAyjAKMEwsACEIrjKCRShyCYZRhGcTAJBMIhiGQYAChEZxVhEMgzDjIAxSJAcQRFESaAABGCQGh+N4/S4NIi0CIsZQjCaiZ7pKA5bgMCo+UrNMixZQVCSOGChYRpCaZWpGGodQRUFbVHAlKypJKCKrEWSrDhuYAAW7XM7yBS1TzVNSuLZtaLqSroAJ1WTWMB0Ra8NzZEKfaZACj4arKejrRDCMAggI=") oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,128) oChart:FirstVisibleDate := "01/01/2001" oBar := oChart:Bars:Item("Task") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oBar1 := oChart:Bars:Item("Summary") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1:SetProperty("Color",0x2000000) oItems := oG2antt:Items() hSummaryJ := oItems:AddItem("Summary A") oItems:AddBar(hSummaryJ,"Summary","01/02/2001","01/02/2001","J") hTaskJ := oItems:InsertItem(hSummaryJ,,"Task A.1") oItems:AddBar(hTaskJ,"Task","01/02/2001","01/05/2001","J1") hTaskJ := oItems:InsertItem(hSummaryJ,,"Task A.2") oItems:AddBar(hTaskJ,"Task","01/04/2001","01/08/2001","J2") oItems:DefineSummaryBars(hSummaryJ,"J",-1,"<*>") hSummaryK := oItems:AddItem("Summary B") oItems:AddBar(hSummaryK,"Summary","01/02/2001","01/02/2001","K") hTaskK := oItems:InsertItem(hSummaryK,,"Task B.1") oItems:AddBar(hTaskK,"Task","01/02/2001","01/05/2001","K1") hTaskK := oItems:InsertItem(hSummaryK,,"Task B.2") oItems:AddBar(hTaskK,"Task","01/04/2001","01/08/2001","K2") oItems:DefineSummaryBars(hSummaryK,"K",-1,"<*>") oItems:SetProperty("ItemBar",0,"<K*>",33/*exBarColor*/,255) hSummaryZ := oItems:AddItem("Summary B") oItems:AddBar(hSummaryZ,"Summary","01/02/2001","01/02/2001","Z") hTaskZ := oItems:InsertItem(hSummaryZ,,"Task B.1") oItems:AddBar(hTaskZ,"Task","01/02/2001","01/05/2001","Z1") hTaskZ := oItems:InsertItem(hSummaryZ,,"Task B.2") oItems:AddBar(hTaskZ,"Task","01/04/2001","01/08/2001","Z2") oItems:DefineSummaryBars(hSummaryZ,"Z",-1,"<*>") oItems:SetProperty("ItemBar",hSummaryZ,"Z",33/*exBarColor*/,16842496) oItems:SetProperty("ItemBar",0,"<Z1>",33/*exBarColor*/,50266112) oItems:SetProperty("ItemBar",0,"<Z2>",33/*exBarColor*/,33554176) oItems:SetProperty("ExpandItem",0,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1957 |
How can I display the week-number in ISO8601 format
|
1956 |
I have a column right-aligned. How can I display its check box aligned to the right, as it appears to the left of the cell's caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:ColumnAutoResize := .T. oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:DrawGridLines := 2/*exVLines*/ oColumns := oG2antt:Columns() oColumn := oColumns:Add("Left") oColumn:AllowSizing := .F. oColumn:Width := 96 oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:FormatColumn := "0 pos `A-Z`" oColumn1 := oColumns:Add("Center") oColumn1:HeaderAlignment := 1/*CenterAlignment*/ oColumn1:Alignment := oColumn1:HeaderAlignment() oColumn1:AllowSizing := .F. oColumn1:Width := 96 oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:FormatColumn := "0 pos `A-Z`" oColumn2 := oColumns:Add("Right") oColumn2:HeaderAlignment := 2/*RightAlignment*/ oColumn2:Alignment := oColumn2:HeaderAlignment() oColumn2:AllowSizing := .F. oColumn2:Width := 96 oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn2:FormatColumn := "0 pos `A-Z`" oColumn2:SetProperty("Def",34/*exCellDrawPartsOrder*/,"caption,check,icon,icons,picture") oColumns:Add("") oItems := oG2antt:Items() oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1) oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1) oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1955 |
Can I display the column's multiple-lines caption vertically oriented (method 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:HeaderHeight := 48 oG2antt:ColumnAutoResize := .T. oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumns := oG2antt:Columns() oColumns:Add("And others ...") oColumn := oColumns:Add("") oColumn:HTMLCaption := "First Column" oColumn:HeaderVertical := .T. oColumn:Width := 36 oColumn:AllowSizing := .F. oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn:Position := 0 oColumn1 := oColumns:Add("") oColumn1:HTMLCaption := "<c><b>Second Column" oColumn1:HeaderVertical := .T. oColumn1:Width := 36 oColumn1:AllowSizing := .F. oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn1:Position := 1 oColumn2 := oColumns:Add("") oColumn2:HTMLCaption := "<r>Third Column" oColumn2:HeaderVertical := .T. oColumn2:Width := 36 oColumn2:AllowSizing := .F. oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn2:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn2:Position := 2 oItems := oG2antt:Items() oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1) oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1) oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1954 |
Can I display the column's multiple-lines caption vertically oriented (method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:HeaderHeight := 48 oG2antt:HeaderSingleLine := .F. oG2antt:ColumnAutoResize := .T. oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumns := oG2antt:Columns() oColumns:Add("And others ...") oColumn := oColumns:Add("First Column") oColumn:HeaderVertical := .T. oColumn:Width := 36 oColumn:AllowSizing := .F. oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn:Position := 0 oColumn1 := oColumns:Add("Second Column") oColumn1:HeaderBold := .T. oColumn1:HeaderVertical := .T. oColumn1:Width := 36 oColumn1:AllowSizing := .F. oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn1:Position := 1 oColumn2 := oColumns:Add("Third Column") oColumn2:HeaderVertical := .T. oColumn2:Width := 36 oColumn2:AllowSizing := .F. oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn2:SetProperty("Def",48/*exCellPaddingLeft*/,8) oColumn2:Position := 2 oItems := oG2antt:Items() oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1) oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1) oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1953 |
Can I display the column's caption vertically oriented (method 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:HeaderHeight := 48 oG2antt:ColumnAutoResize := .T. oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumns := oG2antt:Columns() oColumns:Add("And others ...") oColumn := oColumns:Add("") oColumn:HTMLCaption := "First" oColumn:HeaderVertical := .T. oColumn:Width := 20 oColumn:AllowSizing := .F. oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:Position := 0 oColumn1 := oColumns:Add("") oColumn1:HTMLCaption := "<c><b>Second" oColumn1:HeaderVertical := .T. oColumn1:Width := 20 oColumn1:AllowSizing := .F. oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:Position := 1 oColumn2 := oColumns:Add("") oColumn2:HTMLCaption := "<r>Third" oColumn2:HeaderVertical := .T. oColumn2:Width := 20 oColumn2:AllowSizing := .F. oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn2:Position := 2 oItems := oG2antt:Items() oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1) oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1) oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1952 |
Can I display the column's caption vertically oriented (method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:HeaderHeight := 48 oG2antt:ColumnAutoResize := .T. oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumns := oG2antt:Columns() oColumns:Add("And others ...") oColumn := oColumns:Add("First") oColumn:HeaderVertical := .T. oColumn:Width := 20 oColumn:AllowSizing := .F. oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:Position := 0 oColumn1 := oColumns:Add("Second") oColumn1:HeaderBold := .T. oColumn1:HeaderVertical := .T. oColumn1:Width := 20 oColumn1:AllowSizing := .F. oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:Position := 1 oColumn2 := oColumns:Add("Third") oColumn2:HeaderVertical := .T. oColumn2:Width := 20 oColumn2:AllowSizing := .F. oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn2:Position := 2 oItems := oG2antt:Items() oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1) oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1) oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1951 |
How can I resize all task-bars 0-length
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/03/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/05/2017") oItems:SetProperty("ItemBarEx","itembar(513) = 0 and itembar(0) = `Task`",33/*exBarColor*/,255) oItems:SetProperty("ItemBarEx","itembar(513) = 0 and itembar(0) = `Task`",513/*exBarDuration*/,"value + 1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1950 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 3)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oColumn := oG2antt:Columns():Add("Duration") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oColumn:Visible := .F. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oConditionalFormat := oG2antt:ConditionalFormats():Add("%1 = 0") oConditionalFormat:Bold := .T. oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 190,190,190 } ) , .F. )) oConditionalFormat:SetProperty("ChartBackColor",oConditionalFormat:BackColor()) oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/03/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/05/2017") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1949 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/03/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/05/2017") oItems:SetProperty("ItemBarEx","itembar(513) = 0",3/*exBarCaption*/,"`zero-length`") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1948 |
Is it possible to mark items that holds items with 0-length (zero,empty, sample 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/03/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/05/2017") oItems:SetProperty("ItemBarEx","itembar(513) = 0",53/*exBarBackgroundExt*/,"`[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]`") oItems:SetProperty("ItemBarEx","itembar(513) = 0",55/*exBarBackgroundExtInflate*/,"`-4,-4,4,4`") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1947 |
How can I find how many tasks/bars of 0-length (zero,empty) do I have
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/03/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/05/2017") DevOut( Transform(oItems:ItemBarEx("itembar(513) = 0",256/*exBarsCount*/),"") ) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1946 |
How can I remove all bars from selected items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oBar := oChart:Bars:Item("Task") oBar:OverlaidType := 3/*exOverlaidBarsStack*/ oBar:OverlaidGroup := "Task,Task-Diff" oBar:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1 := oChart:Bars():CallMethod("Copy","Task","Task-Diff") oBar1:Height := 4 oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar1:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,16) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","08/03/2017","08/09/2017") oItems:SetProperty("SelectItem",h,.T.) h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","08/04/2017","08/13/2017","") oItems:AddBar(h,"Task-Diff","08/05/2017","08/14/2017","P") oItems:SetProperty("SelectItem",h,.T.) oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") DevOut( "Bars before remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oItems:SetProperty("ItemBarEx","itemisselected",9/*exBarKey*/,"`toberemove` + value ") oItems:RemoveBar(0,"<toberemove*>") DevOut( "Bars after remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1945 |
How can I remove task bars from selected items
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oBar := oChart:Bars:Item("Task") oBar:OverlaidType := 3/*exOverlaidBarsStack*/ oBar:OverlaidGroup := "Task,Task-Diff" oBar:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1 := oChart:Bars():CallMethod("Copy","Task","Task-Diff") oBar1:Height := 4 oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar1:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,16) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","08/03/2017","08/09/2017") oItems:SetProperty("SelectItem",h,.T.) h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","08/04/2017","08/13/2017","") oItems:AddBar(h,"Task-Diff","08/05/2017","08/14/2017","P") oItems:SetProperty("SelectItem",h,.T.) oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") DevOut( "Bars before remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oItems:SetProperty("ItemBarEx","itemisselected and itembar(0) = `Task`",9/*exBarKey*/,"`toberemove` + value ") oItems:RemoveBar(0,"<toberemove*>") DevOut( "Bars after remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1944 |
How can I change the pattern for some bars only
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","08/03/2017","08/09/2017") oItems:SetProperty("CellState",h,0,1) h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","08/04/2017","08/13/2017") oItems:SetProperty("CellState",h,0,1) oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx","cellstate(0)",42/*exBarPattern*/,6) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1943 |
How do I apply the same effort to all bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 6/*exPatternBDiagonal*/ oBar:HistogramType := 1/*exHistOverAllocation*/ oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,21/*exBarEffort*/,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1942 |
How do I apply the same percent to all bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars():Add("Task%Progress") oBar:Shortcut := "Task" oBar:SetProperty("Def",14/*exBarShowPercentCaption*/,.T.) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,12/*exBarPercent*/,0.5) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1941 |
How can I set the same duration for all bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,513/*exBarDuration*/,4) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1940 |
How do I move all bars to end at the same date-time
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,545/*exBarMoveEnd*/,"#8/15/2017#") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1939 |
How do I move all bars to start at the same date-time
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,544/*exBarMoveStart*/,"#8/2/2017#") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1938 |
How do I apply a new color for some bars, while others should be shown with a different color
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oBar := oChart:Bars:Item("Task") oBar:OverlaidType := 3/*exOverlaidBarsStack*/ oBar:OverlaidGroup := "Task,Task-Diff" oBar:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1 := oChart:Bars():CallMethod("Copy","Task","Task-Diff") oBar1:Height := 4 oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar1:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,16) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","08/04/2017","08/13/2017","") oItems:AddBar(h,"Task-Diff","08/05/2017","08/14/2017","P") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx",.T.,33/*exBarColor*/,"cellcaption(0) like `*2` ? 0x0000FF : 0x00FF00") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1937 |
How do I hide some bars, and show others
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oBar := oChart:Bars:Item("Task") oBar:OverlaidType := 3/*exOverlaidBarsStack*/ oBar:OverlaidGroup := "Task,Task-Diff" oBar:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1 := oChart:Bars():CallMethod("Copy","Task","Task-Diff") oBar1:Height := 4 oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oBar1:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%0%>") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,16) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","08/03/2017","08/09/2017") oItems:SetProperty("SelectItem",h,.T.) h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","08/04/2017","08/13/2017","") oItems:AddBar(h,"Task-Diff","08/05/2017","08/14/2017","P") oItems:SetProperty("SelectItem",h,.T.) oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") oItems:SetProperty("ItemBarEx","-1",19/*exBarTransparent*/,"itembar(0) = `Task` ? 0 : 100") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1936 |
I like how ItemBarEx works, the question is how can I remove the bars based on the same criteria
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","08/02/2017","08/06/2017") oItems:AddBar(oItems:AddItem("Task 2"),"Task","08/03/2017","08/09/2017") oItems:AddBar(oItems:AddItem("Task 3"),"Task","08/04/2017","08/13/2017") oItems:AddBar(oItems:AddItem("Task 4"),"Task","08/05/2017","08/16/2017") DevOut( "Bars before remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oItems:SetProperty("ItemBarEx","cellcaption(0) like `*2 *3`",9/*exBarKey*/,"`toberemove` + value ") oItems:RemoveBar(0,"<toberemove*>") DevOut( "Bars after remove: " ) DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") ) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1935 |
Is it possible to automatically color the bar being checked
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:SelBackMode := 1/*exTransparent*/ oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,256) oChart:FirstVisibleDate := "01/01/2017" oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0","check") oConditionalFormat:Bold := .T. oConditionalFormat:ApplyToBars := "Task" oConditionalFormat:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oColumn := oG2antt:Columns():Add("Items") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:Width := 256 oG2antt:Columns():Add(oG2antt:ConditionalFormats:Item("check"):Expression()):FormatColumn := oG2antt:ConditionalFormats:Item("check"):Expression() oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2017","01/12/2017") h := oItems:AddItem("Item 2") oItems:AddBar(h,"Task","01/03/2017","01/13/2017") oItems:SetProperty("CellState",h,0,1) h := oItems:AddItem("Item 3") oItems:AddBar(h,"Task","01/04/2017","01/14/2017") oItems:SetProperty("CellState",h,0,1) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1934 |
How do I automatically bold items being checked
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oConditionalFormat LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oConditionalFormat := oG2antt:ConditionalFormats():Add("%CS0","check") oConditionalFormat:Bold := .T. oG2antt:Columns():Add("Items"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oG2antt:Columns():Add(oG2antt:ConditionalFormats:Item("check"):Expression()):FormatColumn := oG2antt:ConditionalFormats:Item("check"):Expression() oItems := oG2antt:Items() oItems:AddItem("Item 1") oItems:SetProperty("CellState",oItems:AddItem("Item 2"),0,1) oItems:AddItem("Item 3") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1933 |
Can I display the radio-button with a solid color
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:SetProperty("RadioImage",.F.,32699122) oG2antt:SetProperty("RadioImage",.T.,16777216) oG2antt:Columns():Add("Check"):SetProperty("Def",1/*exCellHasRadioButton*/,.T.) oItems := oG2antt:Items() oItems:AddItem("Radio 1") oItems:SetProperty("CellState",oItems:AddItem("Radio 2"),0,1) oItems:AddItem("Radio 1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1932 |
Can I display the check-box with a solid color
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:SetProperty("CheckImage",0/*Unchecked*/,32699122) oG2antt:SetProperty("CheckImage",1/*Checked*/,16777216) oG2antt:Columns():Add("Check"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oItems := oG2antt:Items() oItems:AddItem("Check 1") oItems:SetProperty("CellState",oItems:AddItem("Check 2"),0,1) oItems:AddItem("Check 3") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1931 |
How can I use the CellState with ConditionalFormat/ComputedField/FormatColumn
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := 4/*exGroupLinesInsideLeaf*/ oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Items") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn1 := oG2antt:Columns():Add("Format") oColumn1:FormatColumn := "%CS0" oColumn1:Caption := oColumn1:FormatColumn() oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504) oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/)) oItems := oG2antt:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Item 1") oItems:SetProperty("CellState",oItems:InsertItem(h,,"Item 2"),0,1) oItems:SetProperty("CellState",oItems:InsertItem(h,,"Item 3"),0,1) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1930 |
How can I use the CellData with ConditionalFormat/ComputedField/FormatColumn
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:Columns():Add("Items") oColumn := oG2antt:Columns():Add("Format") oColumn:FormatColumn := "%CD0" oColumn:Caption := oColumn:FormatColumn() oColumn:SetProperty("Def",5/*exCellForeColor*/,8421504) oColumn:SetProperty("Def",8/*exHeaderForeColor*/,oColumn:Def(5/*exCellForeColor*/)) oItems := oG2antt:Items() oItems:SetProperty("CellData",oItems:AddItem("Item 1"),0,1234) oItems:SetProperty("CellData",oItems:AddItem("Item 2"),0,"this is just an user data") oItems:SetProperty("CellData",oItems:AddItem("Item 3"),0,"01/01/2001") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1929 |
How can I use the CellValue/CellCaption with ConditionalFormat/ComputedField/FormatColumn
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2 LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Items") oEditor := oColumn:Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:AddItem(1,"Item 1") oEditor:AddItem(2,"Item 2") oEditor:AddItem(3,"Item 3") oColumn1 := oG2antt:Columns():Add("Format") oColumn1:FormatColumn := "%0" oColumn1:Caption := oColumn1:FormatColumn() oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504) oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/)) oColumn1:AllowSizing := .F. oColumn2 := oG2antt:Columns():Add("Format") oColumn2:FormatColumn := "%C0" oColumn2:Caption := oColumn2:FormatColumn() oColumn2:SetProperty("Def",5/*exCellForeColor*/,8421504) oColumn2:SetProperty("Def",8/*exHeaderForeColor*/,oColumn2:Def(5/*exCellForeColor*/)) oColumn2:AllowSizing := .F. oItems := oG2antt:Items() oItems:AddItem(1) oItems:SetProperty("CellValue",oItems:AddItem(0),0,2) oItems:AddItem(2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1928 |
How can I use the ShowNonworkingHours property (hide the non-working hours)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:UnitScale := 65536/*exHour*/ oChart:NonworkingHours := 16253183 oChart:ShowNonworkingHours := .F. oChart:ShowNonworkingUnits := .F. oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1927 |
How can I use the ShowNonworkingDates property (hide the non-working days)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:UnitScale := 4096/*exDay*/ oChart:ShowNonworkingDates := .F. oChart:ShowNonworkingUnits := .F. oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1926 |
How can I show/hide bars once the user checks or un-checks a column
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("ItemBarEx",.T.,19/*exBarTransparent*/,"cellstate(0) = 1 ? 0 : 100") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oItems:SetProperty("ItemBarEx",.T.,19/*exBarTransparent*/,"cellstate(0) = 1 ? 0 : 100") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1925 |
How can I change the color for all Task bars
|
1924 |
Is it possible to automatically select bars only when user selects a new item
PROCEDURE OnSelectionChanged(oG2antt) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("ItemBarEx",.T.,257/*exBarSelected*/,"itemisselected") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:SelectionChanged := {|| OnSelectionChanged(oG2antt)} /*Fired after a new item has been selected.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Tasks") oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart := oG2antt:Chart() oChart:AllowSelectObjects := 0/*exNoSelectObjects*/ oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1923 |
Is it possible to automatically select bars only when the user clicks the column's checkbox
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("ItemBarEx",.T.,257/*exBarSelected*/,"cellstate(0) = 1") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart := oG2antt:Chart() oChart:AllowSelectObjects := 0/*exNoSelectObjects*/ oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:SetProperty("CellState",hChild,0,1) oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1922 |
How do I select all bars on leaf items
|
1921 |
How can I change the caption for all checked Task bars
|
1920 |
How can I change the caption for all Task bars
|
1919 |
How can I change the caption for all bars
|
1918 |
How can I move all Task bars to end at the same date time
|
1917 |
How can I move all Task bars to start at the same date time
|
1916 |
How can I change the color for checked Task bars
|
1915 |
How do I resize all Task bars programatically
|
1914 |
How do I move just the checked Task bars in the chart
|
1913 |
How do I move all Task bars in the chart
|
1912 |
How do I count all Task bars in the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h,hChild oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Tasks") oG2antt:HeaderVisible := 1/*exHeaderVisibleExtendLevels*/ oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/01/2017" oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Summary") oBar:StartShape := 0/*exShapeIconEmpty*/ oBar:EndShape := 0/*exShapeIconEmpty*/ oBar:Shape := 20/*exShapeThinDown*/ oChart:SetProperty("SelBackColor",oG2antt:SelBackColor()) oChart:SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:AddBar(hChild,"Task","08/02/2017","08/08/2017") hChild := oItems:InsertItem(h,,"Task 2") oItems:AddBar(hChild,"Task","08/03/2017","08/10/2017") hChild := oItems:InsertItem(h,,"Task 3") oItems:AddBar(hChild,"Task","08/04/2017","08/12/2017") oItems:AddBar(h,"Summary","08/01/2017","08/01/2017","sum") oItems:DefineSummaryBars(h,"sum",-3,"") oItems:SetProperty("ExpandItem",h,.T.) DevOut( Transform(oItems:ItemBarEx("itembar(0) = `Task`",256/*exBarsCount*/),"") ) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1911 |
How do I select bars whose items are checked
|
1910 |
How can I select all bars, where a specified column matches a specified criteria
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,48) oG2antt:Chart():SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1","K1") oItems:AddBar(h,"Task","01/05/2001","01/07/2001","K2","K2") oItems:AddBar(h,"Task","01/08/2001","01/10/2001","P","P") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","Q","Q") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","M","M") oItems:SetProperty("ItemBarEx","cellcaption(0) = `Task 1`",257/*exBarSelected*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1909 |
How can I select/unselect all bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oG2antt:Chart():SetProperty("PaneWidth",.F.,48) oG2antt:Chart():SetProperty("SelBarColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1","K1") oItems:AddBar(h,"Task","01/05/2001","01/07/2001","K2","K2") oItems:AddBar(h,"Task","01/08/2001","01/10/2001","P","P") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","Q","Q") oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","M","M") oItems:SetProperty("ItemBarEx",.T.,257/*exBarSelected*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1908 |
Is it possible to set the background color of the chart for one item and one day
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Items") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddItem("Item") h := oItems:AddItem("Item") oItems:AddBar(h,"","01/02/2001","01/03/2001","Back"," ") oItems:SetProperty("ItemBar",h,"Back",7/*exBarBackColor*/,255) oItems:SetProperty("ItemBar",h,"Back",29/*exBarSelectable*/,.F.) oItems:AddItem("Item") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1907 |
It is possible to search for an item ( inside the Editor ), case insensitive
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oEditor := oG2antt:Columns():Add("DropDownList"):Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:AddItem(1,"One") oEditor:AddItem(2,"Two") oEditor:AddItem(3,"Three") oItems := oG2antt:Items() oItems:AddItem(oG2antt:Columns:Item(0):Editor():FindItem(">ONE")) oItems:AddItem(oG2antt:Columns:Item(0):Editor():FindItem(">ThRee")) oItems:AddItem(oG2antt:Columns:Item(0):Editor():FindItem("ONE")) oItems:AddItem(oG2antt:Columns:Item(0):Editor():FindItem(">tWo")) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1906 |
The text after the BR-tag is in same line as the text before the BR-tag (entire column)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DrawGridLines := 1/*exHLines*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Default") oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.) oItems := oG2antt:Items() oItems:AddItem("This is the first line.<br>This is the second line.") oItems:AddItem("This is the first line.<br>This is the second line.") oItems:AddItem("This is the first line.<br>This is the second line.") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1905 |
The text after the BR-tag is in same line as the text before the BR-tag (individual)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DrawGridLines := 1/*exHLines*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:Columns():Add("Default") oItems := oG2antt:Items() oItems:SetProperty("CellValueFormat",oItems:AddItem("This is the first line.<br>This is the second line."),0,1/*exHTML*/) h := oItems:AddItem("<b>This is the first line.<br>This is the second line.</b>") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/) oItems:SetProperty("CellValueFormat",oItems:AddItem("This is the first line.<br>This is the second line."),0,1/*exHTML*/) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1904 |
How do I prevent showing the control's BackColorAlternate property on empty / non-items part of the control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DrawGridLines := -1/*exAllLines*/ oChart := oG2antt:Chart() oChart:DrawGridLines := -1/*exAllLines*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,128) oChart:FirstVisibleDate := "01/01/2001" oG2antt:SetProperty("BackColorAlternate",0x7ff0f0f0) oG2antt:SetProperty("BackColorLevelHeader",oG2antt:BackColor()) oG2antt:Columns():Add("Column") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/12/2001") oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/13/2001") oItems:AddBar(oItems:AddItem("Item 3"),"Task","01/02/2001","01/12/2001") oItems:AddBar(oItems:AddItem("Item 4"),"Task","01/03/2001","01/13/2001") oItems:AddBar(oItems:AddItem("Item 5"),"Task","01/02/2001","01/12/2001") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1903 |
Can I disable an item once the user selects a new value into a different item
PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("EnableItem",oItems:ItemByIndex(1),.F.) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oEditor LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oG2antt:FreezeEvents(.T.) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:ScrollBySingleLine := .T. oG2antt:DrawGridLines := -2/*exRowLines*/ oG2antt:Columns():Add("Q") oG2antt:Columns():Add("A") oItems := oG2antt:Items() h1 := oItems:AddItem("What's your gender?") oEditor := oItems:CellEditor(h1,1) oEditor:EditType := 3/*DropDownListType*/ oEditor:AddItem(1,"Male") oEditor:AddItem(0,"Female") oItems:SetProperty("CellValue",h1,1,1) h2 := oItems:AddItem("What's pet name?") oItems:SetProperty("CellValue",h2,1,"This is my pet favorite long long long name, that shoul break the line in multiple pieces") oItems:SetProperty("CellSingleLine",h2,1,0/*exCaptionWordWrap*/) oG2antt:EndUpdate() oG2antt:FreezeEvents(.F.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1902 |
How can I get a row expanded / enlarged to fit the cell's text (entire column)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oEditor LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:ScrollBySingleLine := .T. oG2antt:DrawGridLines := -2/*exRowLines*/ oG2antt:Columns():Add("Q") oColumn := oG2antt:Columns():Add("A") oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.) oEditor := oColumn:Editor() oEditor:EditType := 5/*MemoType*/ oEditor:Appearance := 8/*SingleApp*/ oItems := oG2antt:Items() h1 := oItems:AddItem("What's name?") oItems:SetProperty("CellValue",h1,1,"This is my pet favorite long long long name, that shoul break the line in multiple pieces") h2 := oItems:AddItem("What's your pet name?") oItems:SetProperty("CellValue",h2,1,"This is my pet favorite long long long name, that shoul break the line in multiple pieces") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1901 |
How can I get a row expanded / enlarged to fit the cell's text (individual cell)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oEditor LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:ScrollBySingleLine := .T. oG2antt:DrawGridLines := -2/*exRowLines*/ oG2antt:Columns():Add("Q") oG2antt:Columns():Add("A") oItems := oG2antt:Items() h1 := oItems:AddItem("What's name?") oItems:SetProperty("CellValue",h1,1,"This is my pet favorite long long long name, that shoul break the line in multiple pieces") h2 := oItems:AddItem("What's your pet name?") oEditor := oItems:CellEditor(h2,1) oEditor:EditType := 5/*MemoType*/ oEditor:Appearance := 8/*SingleApp*/ oItems:SetProperty("CellValue",h2,1,"This is my pet favorite long long long name, that shoul break the line in multiple pieces") oItems:SetProperty("CellSingleLine",h2,1,0/*exCaptionWordWrap*/) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |